<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCustomerDepartmentClueRecordTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('customer_department_clue_record', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('taskId')->default(0)->comment('关联任务ID');
            $table->unsignedTinyInteger('status')->default(0)->comment('线索状态');
            $table->string('wgNumber', 12)->default('')->comment('网规编号');
            $table->unsignedTinyInteger('wgType')->default(0)->comment('网规类型');
            $table->unsignedInteger('preHaving')->default(0)->comment('预计出铺日期');
            $table->unsignedInteger('followUpTime')->default(0)->comment('最新跟进时间');
            $table->text('content')->nullable()->default('')->comment('线索记录');
            $table->unsignedInteger('berthCount')->default(0)->comment('铺位数量');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '大客户部线索记录';

            $table->index('taskId', 'idx_taskId');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('customer_department_clue_record');
    }
}
